/*
 * Copyright (c) 2010 Mathias Garbe <code@mathias-garbe.de>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#ifndef CLIENT_HPP
#define CLIENT_HPP

#define _BUILD_VERSION 36
#define _SETTINGS_VERSION 4

// libcurl
#ifndef _DEBUG
#define CURL_STATICLIB
#endif

#include <curl/curl.h>

// C++ std
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>

// Windows files
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
#include <windows.h>
#include <tlhelp32.h>
// Qt
#include <QApplication>
#include <QDesktopWidget>
#include <QtGui/QApplication>
#include <QSettings>
#include <QString>
#include <QDir>
#include <QFile>

// CnCnet Launcher
#include "config.h"
#include "common.h"
#include "launcher.h"

#include "ThreadingVector.hpp"
#include "Packet.hpp"

#include "IRC.hpp"

namespace LauncherHooks
{
    ThreadingVector<Packet> *incomingPacketInstance(ThreadingVector<Packet> *itc = 0, bool reset = false);
    ThreadingVector<Packet> *outgoingPacketInstance(ThreadingVector<Packet> *itc = 0, bool reset = false);
}

namespace Qt
{
    static QApplication *QAppInstance(QApplication *q = 0)
    {
        static QApplication *qapp;
        if(q != 0)
        {
            qapp = q;
        }

        return qapp;
    }

    static void QAppInit()
    {
        QCoreApplication::setOrganizationName("CnCNet-Team");
        QCoreApplication::setOrganizationDomain("cncnet.cnc-comm.com");
        QCoreApplication::setApplicationName("CnCNet Client");
        QSettings::setDefaultFormat(QSettings::IniFormat);
    }

    // QSettings
}

// Helper functions 
#include "Helper.hpp"

// Classes
#include "Update.hpp"
#include "Packet.hpp"
#include "Games.hpp"
#include "GameInfo.hpp"
#include "OnlineStatus.hpp"

// Qt Windows
#include "SettingsWindow.hpp"
#include "MainWindow.hpp"
#include "AutoUpdateWindow.hpp"

#endif
